//
//  MSBookersOpenRankCell.m
//  觅尚
//
//  Created by No.8 on 2019/3/27.
//  Copyright © 2019 No.8. All rights reserved.
//

#import "MSBookersOpenRankCell.h"

@implementation MSBookersOpenRankCell

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    MSBookersOpenRankCell * cell = [tableView dequeueReusableCellWithIdentifier:[MSBookersOpenRankCell ID]];
    cell = [[MSBookersOpenRankCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[MSBookersOpenRankCell ID]];
    cell.backgroundColor = BackViewColor;
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setMember];
        
    }
    return self;
}

- (void)setMember{
    
    
    /** 排名*/
    self.RankingLabel = [[UILabel alloc] initWithFrame:CGRectMake(50 * px, 30 * px, 50 * px, 60 * px)];
    self.RankingLabel.textColor = [UIColor whiteColor];
    self.RankingLabel.font = [UIFont systemFontOfSize:SYRealValue(35 / 2)];
    [self addSubview:self.RankingLabel];
    
    /** 日历按钮*/
    self.PhotoIMG = [[UIImageView alloc] initWithFrame:CGRectMake(150 * px, 20 * px, 80 * px, 80 * px)];
    self.PhotoIMG.image = [UIImage imageNamed:@"chaoxiaofei"];
    self.PhotoIMG.layer.cornerRadius = 40 * px;
    [self addSubview:self.PhotoIMG];
    
    
    
    
    
    /** 昵称*/
    self.NameLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.PhotoIMG.frame) + 30 * px, self.PhotoIMG.y, ScreenWidth, self.PhotoIMG.height)];
    self.NameLabel.textColor = [UIColor whiteColor];
    self.NameLabel.text = @"张丽：9间";
    self.NameLabel.textAlignment = NSTextAlignmentLeft;
    self.NameLabel.font = [UIFont systemFontOfSize:SYRealValue(30 / 2)];
    [self addSubview:self.NameLabel];
    
    
    /** 房间个数*/
    self.CountLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.PhotoIMG.x, CGRectGetMaxY(self.PhotoIMG.frame) + 20 * px, ScreenWidth, self.PhotoIMG.height)];
    self.CountLabel.textColor = [UIColor darkGrayColor];
    self.CountLabel.text = @"302";
    self.CountLabel.textAlignment = NSTextAlignmentLeft;
    self.CountLabel.font = [UIFont systemFontOfSize:SYRealValue(26 / 2)];
    [self addSubview:self.CountLabel];
    
    
    self.linView = [[UIView alloc] initWithFrame:CGRectMake(0, 200 * px - 1, ScreenWidth, 1)];
    self.linView.backgroundColor = [UIColor darkGrayColor];
    [self addSubview:self.linView];
    
    
}
- (void)setBookerRankModel:(MSBookerRankModel *)BookerRankModel{
    _BookerRankModel = BookerRankModel;
    
    [self.PhotoIMG sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",BookerRankModel.avatarUrl]] placeholderImage:[UIImage imageNamed:@"我的头像占位符"]];
    
    self.NameLabel.text = [NSString stringWithFormat:@"%@: %@间",BookerRankModel.userName,BookerRankModel.count];
    
    self.CountLabel.text = [NSString stringWithFormat:@"%@",BookerRankModel.roomNames];
}
+(NSString *)ID{
    return @"cell";
}
@end
